package com.akino.gulimall.seckill.scheduled;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author Akino
 * @version 1.0
 * 定时任务
 */
@Slf4j
//@Component
//@EnableScheduling // 开启定时任务
//@EnableAsync // 开启异步任务
public class HelloSchedule {
    @Async  // 异步任务
    @Scheduled(cron = "* * * * * ?")  // 开启一个定时任务
    public void Hello(){
        log.info("hello");
    }
}
